package com.gkzf.ai.module.crm.dal.mysql.product;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gkzf.ai.framework.common.pojo.PageResult;
import com.gkzf.ai.framework.mybatis.core.mapper.BaseMapperX;
import com.gkzf.ai.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.gkzf.ai.module.crm.controller.admin.product.vo.repayment.CrmProductRepaymentPageReqVO;
import com.gkzf.ai.module.crm.dal.dataobject.product.CrmProductRepaymentDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.poi.ss.formula.functions.T;

import java.util.List;

/**
 * @author Huawei
 * @date 2025-03-31
 */
@Mapper
public interface CrmProductRepaymentMapper extends BaseMapperX<CrmProductRepaymentDO> {
    default PageResult<CrmProductRepaymentDO> selectPage(CrmProductRepaymentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CrmProductRepaymentDO>()
                .eqIfPresent(CrmProductRepaymentDO::getProductId, reqVO.getProductId())
                .likeIfPresent(CrmProductRepaymentDO::getName, reqVO.getName())
                .eqIfPresent(CrmProductRepaymentDO::getNo, reqVO.getNo())
                .orderByDesc(CrmProductRepaymentDO::getId));
    }

}
